﻿package bdz.projects.slab.core {
	import bdz.projects.slab.events.SlabSiteEvent;
	import flash.display.MovieClip;
	import flash.events.*;
	import bdz.common.utils.TweenLite;
	import fl.transitions.easing.*;
	/**
	* ...
	* @author Default
	*/
	public class SlabSection extends MovieClip {
		protected var transSpeed:Number = 1.3;
		function SlabSection() {
			addEventListener(Event.ADDED_TO_STAGE, initializeComponent);
		}
		protected function initializeComponent(evt:Event):void {
			alpha = 0;
			transitionIn();
		}
		protected function dispatchTransitionOut():void {
			
			dispatchEvent(new SlabSiteEvent(SlabSiteEvent.SECTION_TRANSITIONOUT));
			
		}
		
		public function transitionIn(sp:Number = 0):void {
			
			TweenLite.to(this, sp || transSpeed, { alpha:1, ease:Strong.easeOut } );
		}
		public function transitionOut(sp:Number = 0):void {
			TweenLite.to(this, sp || transSpeed, { alpha:0, ease:Strong.easeOut, onComplete:dispatchTransitionOut } );
		}
	
		
	}
	
}